<template>
	<view class="loading-container">

<!-- 		<view class="" v-for="(iten,index) in dataInfo" :key="index">
			{{iten}}
		</view> -->
		<!-- 入会转会 -->

		<loadingComponentsVue />

	</view>
</template>

<script>
	import loadingComponentsVue from '../../../components/loadingComponents.vue';
	import {
		getUserTokenInfo,
		removeUserTokenInfo
	} from '../../../utils/auth';
	export default {
		components: {
			loadingComponentsVue
		},
		data() {
			return {
				dataInfo: []
			};
		},
		onShow() {
			removeUserTokenInfo()
			this.getUserInfo()
		},
		methods: {
			async getUserInfo() {
				try {
					const {
						platform
					} = uni.getSystemInfoSync();
					// const isMobile = platform === 'ios' || platform === 'android';
					const isMobile = true
					const credentials =
						'(MembersCredential|WorkerMembersCredential)&PhoneNumberCredential';
					const res = await this.userTopAuth(isMobile, credentials);
					this.formDataSet(res);
				} catch (err) {
					console.log(err);
					this.$router.back();
				}
			},
			formDataSet(row) {
				this.dataInfo.push(row)
				console.log(row);
				if (row.MembersCredential) {
					this.dataInfo.push("会员")
					uni.redirectTo({
						url: '/pages/work/membertransfer'
					});
					return
				}
				 
				 else {
					if (row.WorkerMembersCredential) {
						this.dataInfo.push("注册用户")
						uni.redirectTo({
							url: '/pages/work/employeemembership'
						});
						return
					}

				}


			},
		}
	}
</script>

<style scoped>

</style>